﻿using Domain.Entitys.Sinv;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.EntityConfigurations.Sinv
{
    public class Sinv_Sale_Outbound_DetailsConfiguration : IEntityTypeConfiguration<Sinv_Sale_Outbound>
    {
        public void Configure(EntityTypeBuilder<Sinv_Sale_Outbound> builder)
        {
            builder.ToTable("sinv_sale_outbound");
            builder.HasKey(so => so.Sale_outbound_id);

            builder.HasMany(so => so.Details)
                .WithOne(so => so.Main)
                .HasPrincipalKey(so => so.Sale_outbound_id);
        }
    }
}
